package ru.ifmo.network.skype.network.data;

/**
 * @author avhaliullin
 */
public enum MessageType {
    HELLO(0),
    GOODBYE(1),
    AUDIO_DATA(2),
    SECURE(3);
    private final int value;

    MessageType(int value) {
        this.value = value;
    }

    public static MessageType getByValue(int value) {
        for (MessageType type : values()) {
            if (type.value == value) {
                return type;
            }
        }
        return null;
    }

    public int getValue() {
        return value;
    }
}
